import { Component, EventEmitter, Input, Output } from '@angular/core';

/**
 * Generated class for the ChangeColorComponent component.
 *
 * See https://angular.io/api/core/Component for more info on Angular
 * Components.
 */
@Component({
  selector: 'change-color',
  templateUrl: 'change-color.html'
})
export class ChangeColorComponent {
  @Input() checkedColor: string;
  @Output() onclosePallet = new EventEmitter<string>();
  
  cacheColor;
  private colors = ["#ffffff","#ff0000","#fff100","#0099ff","#ec6941",
                    "#100964","#000000","#eb6877","#8957a1","#80c269",
                    "#f19149","#7ecef4","#88abda","#facd89","#a6937c"]

  constructor() {}
  // ngOnChanges(): void {
  //   //暂存画笔颜色
  //   this.cacheColor = this.checkedColor;
  //   console.log(this.cacheColor);
  // }

  //切换画笔颜色 
  // onCheckedColor(color: string): void {
  //   this.checkedColor = color;
  // }

  //关闭调色板 
  changeColor(): void {
    this.onclosePallet.emit()
  }
  //关闭调色板
  cancel(): void {
    this.onclosePallet.emit()
  }
  
}
